<template>
  <div id="app">
    <el-row style="border-bottom: solid 1px #ffffff;box-shadow: 0 2px 8px rgba(0,0,0,0.2);position: fixed;left: 0;top: 0;z-index: 9999;width: 100%;background-color: #ffffff">
      <div class="el-col-10 el-col-offset-1" style="height: 90px">
        <h1>绿索智能</h1>
      </div>
      <div class="el-col-11">
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
          <el-menu-item index="1">首页</el-menu-item>
          <el-menu-item index="2">产品</el-menu-item>
          <el-menu-item index="3">案例</el-menu-item>
          <el-menu-item index="4">资讯</el-menu-item>
          <el-menu-item index="5">加盟</el-menu-item>
          <el-menu-item index="6">关于我们</el-menu-item>
        </el-menu>
      </div>
      <div class="el-col-1">
        <a style="height: 91px;line-height: 91px;font-size: small;color: green;cursor: pointer;text-align: right;" target="_blank" href="https://192.168.2.104:8080/#/login">后台登录</a>
      </div>
      <div class="line"></div>
    </el-row>
    <!--登入动画-->
    <div style="padding-top: 100px">
      <transition name="rotate-fall">
        <router-view  class="app-router-view"></router-view>
      </transition>
    </div>
    <div style="width: 100%;">
      <el-row style="background-color: #28303e;padding:40px 0px 20px 0px;">
        <div class="el-col-10 el-col-offset-6" id="contact">
          <li>
            <i class="fa fa-weibo"></i>
            新浪微博：xxxxx
          </li>
          <li>
            <i class="fa fa-weixin"></i>
            微信公众号：xxxxx
          </li>
          <li>
            <i class="fa fa-phone"></i>
            电话：xxxxx
          </li>
          <li>
            <i class="fa fa-envelope-o"></i>
            邮箱：xxxx@qq.com
          </li>
          <li>
            <i class="fa fa-location-arrow"></i>
            地址：xxxxx
          </li>
        </div>
        <div class="el-col-8" id="weixing">
          <li>
            新浪微博：xxxxx
          </li>
        </div>
        <div class="el-col-24" id="copyright">
          <li style="color: #ffffff;word-wrap:break-word;text-align: center">
            Copyright © 2019 xxxxxxxx All Rights Reserved 网站管理
          </li>
        </div>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: 'App',
    data () {
        return {
            activeIndex: '',
        }
    },
    created:function(){
        this.$nextTick(function () {
            $('.el-submenu__title').css('height','90px');
            $('.el-submenu__title').css('line-height','90px');
            $('.el-submenu__title').css('font-size','15px');
            switch (this.$to.path) {
                case '/':
                    this.activeIndex = '1';
                    break;
                case '/Products':
                    this.activeIndex = '2';
                    break;
                case '/Cases':
                    this.activeIndex = '3';
                    break;
                case '/Information':
                    this.activeIndex = '4';
                    break;
                case '/JoinIn':
                    this.activeIndex = '5';
                    break;
                case '/AboutUs':
                    this.activeIndex = '6';
                    break;
            }
        })
    },
    methods: {
        handleSelect(key, keyPath) {
            var path ='';
            switch (key){
                case '1':
                    path = '/';
                    break;
                case '2':
                    path = '/Products';
                    break;
                case '3':
                    path = '/Cases';
                    break;
                case '4':
                    path = '/Information';
                    break;
                case '5':
                    path = '/JoinIn';
                    break;
                case '6':
                    path = '/AboutUs';
                    break;
            }
            this.$router.push({path: path })
        }
    }
}
</script>

<style>
  .app .app-router-view {
    position: relative;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    overflow: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    transform-style: preserve-3d;
    visibility: visible;
  }
  .el-menu--horizontal>.el-menu-item {
    float: left;
     height: 90px;
     line-height: 90px;
    margin: 0;
    border-bottom: 2px solid transparent;
    color: #909399;
  }
  .el-menu-item {
    font-size: 15px;
    width: 120px;
    text-align: center;
  }
  .el-menu.el-menu--horizontal {
    border-bottom: 0px;
  }
  .el-menu,.el-submenu,.el-menu-item{
    height: 90px;
    line-height: 90px;
    vertical-align: bottom;
  }
  #contact li{
    color: #ffffff;
    padding: 10px 0px;
    font-size: 20px;
    list-style-type:none;
  }
  #contact li i{
    padding: 0px 10px;
    width: 25px;
    color: #fff;
    list-style-type:none;
  }
  #weixing li{
    color: #ffffff;
    list-style-type:none;
  }
  #copyright li{
    color: #b9b9b9;
    height: 60px;
    line-height: 60px;
    vertical-align: middle;
    padding: 10px 0px;
    font-size: 14px;
    list-style-type:none;
  }
</style>
